﻿<%@ Page Language="C#" MasterPageFile="~/Admin/admin.master" AutoEventWireup="true" CodeFile="StockWarning.aspx.cs" Inherits="Admin_StockWarning" Title="" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder2" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">

    <script>
            $(function() {
                var dates = $(".fromdatepicker, .todatepicker").datepicker({
                    defaultDate: "-1m",
                    changeMonth: true,
                    numberOfMonths: 3,
                    dateFormat: 'dd-M-yy',
                    onSelect: function(selectedDate) {
                        var option = this.className == "fromdatepicker hasDatepicker" ? "minDate" : "maxDate",
					instance = $(this).data("datepicker");
                        date = $.datepicker.parseDate(
						instance.settings.dateFormat ||
						$.datepicker._defaults.dateFormat,
						selectedDate, instance.settings);
                        dates.not(this).datepicker("option", option, date);
                    }
                });
                //hide the all of the element with class msg_body
                $(".msg_body").hide();
                //toggle the componenet with class msg_body
                $(".msg_head").click(function() {
                    var bodyeffected = $(this).next(".msg_body");
                    bodyeffected.slideToggle("slow");
                });
            });
    </script>

    <table cellpadding="0" cellspacing="0" style="padding-left: 10px">
        <tr style="border-bottom: solid 1px #fff">
            <td class="literal">
                Select date:
            </td>
            <td>
                <asp:TextBox runat="server" ID="tb_day"  Width="200px"></asp:TextBox>
            </td>
            <td>
                <asp:RequiredFieldValidator ID="rfv_day" runat="server" ErrorMessage="Required"
                    ControlToValidate="tb_day"></asp:RequiredFieldValidator>
             <asp:RangeValidator ID="RangeVal_dataDay" runat="server" Display="Dynamic" ControlToValidate="tb_day" ErrorMessage="Invalid value" MaximumValue="2147483647" MinimumValue="1" Type="Integer"></asp:RangeValidator>

            </td>
        </tr>
       <%-- <tr style="border-bottom: solid 1px #fff">
            <td class="literal">
                To date:
            </td>
            <td>
                <asp:TextBox runat="server" ID="tb_ToDate" CssClass="todatepicker" Width="200px"></asp:TextBox>
            </td>
            <td>
                <asp:RequiredFieldValidator ID="rfv_ToDate" runat="server" ControlToValidate="tb_ToDate"
                    ErrorMessage="Required"></asp:RequiredFieldValidator>
            </td>
        </tr>--%>
        <tr>
            <td>
                &nbsp;
            </td>
            <td>
                <asp:ImageButton ID="btn_Search" runat="server" Width="27px" ImageUrl="~/Admin/resources/images/Search.png"
                    OnClick="btn_Search_Click" />
            </td>
            <td>
                &nbsp;
            </td>
        </tr>
    </table>
<%--    		<data:GridViewSearchPanel ID="GridViewSearchPanel1" runat="server" GridViewControlID="GridView1" PersistenceMethod="Session" />
--%>		<br />
    <%--<data:EntityGridView ID="GridView1" runat="server" AutoGenerateColumns="False" DataSourceID="StockWarningDataSource"
        DataKeyNames="DrugId" AllowMultiColumnSorting="false" DefaultSortColumnName=""
        DefaultSortDirection="Ascending" ExcelExportFileName="Export_Stock.xls" AllowExportToExcel="True"
        AllowPaging="True">
        <Columns>
            <asp:BoundField DataField="DrugId" HeaderText="DrugId" SortExpression="[DrugId]" />
            <data:HyperLinkField HeaderText="Drug Name" DataNavigateUrlFormatString="DrugDispoEdit.aspx?DrugId={0}"
                DataNavigateUrlFields="DrugId"  DataTextField="DrugName" />
              <asp:BoundField DataField="MinStock" HeaderText="MinStock" SortExpression="[MinStock]" />
             <asp:BoundField DataField="MaxStock" HeaderText="MaxStock" SortExpression="[MaxStock]" /> 
            <asp:BoundField DataField="NearestExp" HeaderText="NearestExp" SortExpression="[NearestExp]" />  
             <asp:BoundField DataField="InStock" HeaderText="InStock" SortExpression="[InStock]" />   


        </Columns>
           <FooterStyle BackColor="White" ForeColor="#000066" />
        <HeaderStyle BackColor="#006699" Font-Bold="True" ForeColor="White" />
      
        <RowStyle ForeColor="#000066" />
        <EmptyDataTemplate>
            <b>No Stock Found!</b>
        </EmptyDataTemplate>
    </data:EntityGridView>--%>
    <div style="width: 900px; padding-left: 10px">
        <div id="div_ValidStock" runat="server" class="msuccess">
        </div>
        <div id="div_AlreadyReminder" runat="server" class="mInformation msg_head">
        </div>
         <div class="msg_body">
            <asp:GridView ID="grv_AlreadyReminder" runat="server" AutoGenerateColumns="False"
                DataKeyNames="DrugId" CellPadding="2" ForeColor="Black" GridLines="None"
                Width="900px" BackColor="LightGoldenrodYellow" BorderColor="Tan" BorderWidth="1px">
                <Columns>
            <asp:BoundField DataField="DrugId" HeaderText="DrugId" SortExpression="[DrugId]" />
            <data:HyperLinkField HeaderText="Drug Name" DataNavigateUrlFormatString="DrugDispoEdit.aspx?DrugId={0}"
                DataNavigateUrlFields="DrugId"  DataTextField="DrugName" />
              <asp:BoundField DataField="MinStock" HeaderText="MinStock" SortExpression="[MinStock]" />
             <asp:BoundField DataField="MaxStock" HeaderText="MaxStock" SortExpression="[MaxStock]" /> 
            <asp:BoundField DataField="NearestExp" HeaderText="NearestExp" SortExpression="[NearestExp]" />  
             <asp:BoundField DataField="InStock" HeaderText="InStock" SortExpression="[InStock]" DataFormatString="{0:#,0}" />   


        </Columns>
         <FooterStyle BackColor="White" ForeColor="#000066" />
        <HeaderStyle BackColor="#006699" Font-Bold="True" ForeColor="White" />
      
        <RowStyle ForeColor="#000066" />
            </asp:GridView>
        </div>
        <div class="mwarning  msg_head">
            <div id="div_larMinStock" runat="server">
            </div>
            <div style="float: right; position: relative; top: -20px">
                <%-- <asp:ImageButton ID="btn_Email" Width="32px" runat="server" ImageUrl="~/Images/email.png"
                    ToolTip="Send reminder to all" OnClick="btn_Email_Click" />--%>
            </div>
        </div>
        <div class="msg_body">
            <asp:GridView ID="grv_larMinStock" runat="server" AutoGenerateColumns="False"
                DataKeyNames="DrugId" CellPadding="2" ForeColor="Black" GridLines="None"
                Width="900px" BackColor="LightGoldenrodYellow" BorderColor="Tan" BorderWidth="1px">
                <Columns>
            <asp:BoundField DataField="DrugId" HeaderText="DrugId" SortExpression="[DrugId]" />
            <data:HyperLinkField HeaderText="Drug Name" DataNavigateUrlFormatString="DrugDispoEdit.aspx?DrugId={0}"
                DataNavigateUrlFields="DrugId"  DataTextField="DrugName" />
              <asp:BoundField DataField="MinStock" HeaderText="MinStock" SortExpression="[MinStock]" />
             <asp:BoundField DataField="MaxStock" HeaderText="MaxStock" SortExpression="[MaxStock]" /> 
            <asp:BoundField DataField="NearestExp" HeaderText="NearestExp" SortExpression="[NearestExp]" />  
             <asp:BoundField DataField="InStock" HeaderText="InStock" SortExpression="[InStock]" />   


        </Columns>
         <FooterStyle BackColor="White" ForeColor="#000066" />
        <HeaderStyle BackColor="#006699" Font-Bold="True" ForeColor="White" />
      
        <RowStyle ForeColor="#000066" />
            </asp:GridView>
        </div>
        <div id="div_smallMinStock" runat="server" class="merror msg_head">
        </div>
        <div class="msg_body">
            <asp:GridView ID="grv_smallMinStock" runat="server" AutoGenerateColumns="False"
                DataKeyNames="DrugId" CellPadding="4" ForeColor="#333333"
                GridLines="None" Width="900px">
                <RowStyle BackColor="#FFFBD6" ForeColor="#333333" />
                <Columns>
            <asp:BoundField DataField="DrugId" HeaderText="DrugId" SortExpression="[DrugId]" />
            <data:HyperLinkField HeaderText="Drug Name" DataNavigateUrlFormatString="DrugDispoEdit.aspx?DrugId={0}"
                DataNavigateUrlFields="DrugId"  DataTextField="DrugName" />
              <asp:BoundField DataField="MinStock" HeaderText="MinStock" SortExpression="[MinStock]" />
             <asp:BoundField DataField="MaxStock" HeaderText="MaxStock" SortExpression="[MaxStock]" /> 
            <asp:BoundField DataField="NearestExp" HeaderText="NearestExp" SortExpression="[NearestExp]" />  
             <asp:BoundField DataField="InStock" HeaderText="InStock" SortExpression="[InStock]" />   


        </Columns>
         <FooterStyle BackColor="White" ForeColor="#000066" />
        <HeaderStyle BackColor="#006699" Font-Bold="True" ForeColor="White" />
      
        <RowStyle ForeColor="#000066" />
            </asp:GridView>
        </div>
    </div>
    <br />
 <%--   <data:StockWarningDataSource ID="StockWarningDataSource" runat="server" SelectMethod="GetPaged"
        EnablePaging="True" EnableSorting="True" >
     
        <Parameters>
            <data:CustomParameter Name="WhereClause" Value="" ConvertEmptyStringToNull="false" />
            <data:CustomParameter Name="OrderByClause" Value="" ConvertEmptyStringToNull="false" />
            <asp:ControlParameter Name="PageIndex" ControlID="GridView1" PropertyName="PageIndex"
                Type="Int32" />
            <asp:ControlParameter Name="PageSize" ControlID="GridView1" PropertyName="PageSize"
                Type="Int32" />
            <data:CustomParameter Name="RecordCount" Value="0" Type="Int32" />
        </Parameters>
    </data:StockWarningDataSource>--%>
</asp:Content>
